<!--
 * @Description: 
 * @Version: 2.0
 * @Autor: snzo.chen
 * @Date: 2023-11-22 15:36:58
 * @LastEditors: snzo.chen
 * @LastEditTime: 2023-12-11 09:20:16
-->
<template>
  <div class="action-row">
    <a-space>
      <template v-if="showSelect">
        <a-button type="primary" @click="$emit('subItem')">{{ selText }}</a-button>
      </template>
      <template v-if="showEdit">
        <a-button type="primary" @click="$emit('updateItem')">修改</a-button>
      </template>
      <slot></slot>
      <template v-if="showDel">
        <a-popconfirm
          title="删除有风险"
          okText="确定"
          cancelText="取消"
          @confirm="$emit('deleteItem')"
        >
          <a-button type="primary" danger>删除</a-button>
        </a-popconfirm>
      </template>
    </a-space>
  </div>
</template>
<script lang="ts" setup>
defineOptions({
  name: "TableRowAction",
});
defineProps({
  showSelect: {
    type: Boolean,
    default: true,
  },
  selText: {
    type: String,
    default: "查看",
  },
  showEdit: {
    type: Boolean,
    default: true,
  },
  showDel: {
    type: Boolean,
    default: true,
  },
});
</script>
